﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using UIObjects.DragDropInterfaces;
using UIObjects;

namespace MvvmTreeView
{
    public delegate void ImageAvailableHandler(ITreeNode node);

    // Summary:
    //     Represents a node of a System.Windows.Forms.TreeView.
    public interface ITreeNode : INotifyPropertyChanged, IClonable<ITreeNode>
    {
        event ImageAvailableHandler ImageAvailable;
        event ImageAvailableHandler GlyphAvailable;
        event ImageAvailableHandler LayoverImageAvailable;
        event NodeLabelEditEventHandler AfterLabelEdit;
        event NodeLabelEditEventHandler BeforeLabelEdit;
        event EventHandler DblClick;
        List<string> AddNewShortCuts { get; }
        void AddNew(string shortCut);
        void DragStarting(object sender, ItemDragEventArgs e);
        void DragCompleted(object sender, ItemDragEventArgs e);
        void ItemDropped(object sender, ItemDragEventArgs e, int insertionIndex);
        void GiveFeedback(object sender, GiveFeedbackEventArgs e);
        void DragEnter(object sender, DragEventArgs e);
        void DragLeave(object sender, DragEventArgs e);
        void DragOver(object sender, DragEventArgs e);
        void OnDblClick(object sender, EventArgs e);
        bool HasLayoverImage<T>(out T image);
        string SelectionStatus { get; }
        object BackColor { get; set; }
        object Bounds { get; }
        bool Checked { get; set; }
        ContextMenu ContextMenu { get; set; }
        ITreeNode FirstNode { get; }
        string FullPath { get; }
        int ImageIndex { get; set; }
        string ImageKey { get; set; }
        bool IsEditing { get; }
        bool IsExpanded { get; }
        bool IsSelected { get; }
        bool IsChildrenLoaded { get; }
        void LoadChildren();
        bool? HasChildren { get; }
        bool IsVisible { get; }
        bool AllowRename { get; }
        bool AllowDrop { get; }
        ITreeNode LastNode { get; }
        int Level { get; }
        float ChildOrdinal { get; set; }
        string Text { get; set; }
        object TreeViewItem { get; set; }
        object ItemContent { get; set; }
        ITreeNode NextNode { get; }
        ITreeNode NextVisibleNode { get; }
        TreeNodeCollection Nodes { get; }
        ITreeNode Parent { get; }
        ITreeNode PrevNode { get; }
        ITreeNode PrevVisibleNode { get; }
        int SelectedImageIndex { get; set; }
        string SelectedImageKey { get; set; }
        int StateImageIndex { get; set; }
        string StateImageKey { get; set; }
        object Image { get; }
        object Glyph { get; }
        object LayoverImage { get; }
        object Tag { get; set; }
        string ToolTipText { get; set; }
        ITreeView TreeView { get; }
        void BeginEdit();
        void EndEdit(bool cancel);
        object Clone();
        void OnSelect();
        void Collapse();
        void Collapse(bool ignoreChildren);
        void EnsureVisible();
        void Expand();
        void ExpandAll();
        int GetNodeCount(bool includeSubTrees);
        void Remove();
        void StartLoadImage();
        void Toggle();
        string ToString();
        EditNode AddEditNode(int imageIndex, string text);
        void FireAfterLabelEdit(string text);
        void FireBeforeLabelEdit();
        INodeExpander NodeExpander { get; set; }

        ////protected void OnKeyDown(KeyEventArgs e);
        ////protected void OnKeyPress(KeyPressEventArgs e);
        ////protected void OnKeyUp(KeyEventArgs e);
        ////protected void OnBeforeLabelEdit(NodeLabelEditEventArgs e);
        ////protected void OnAfterLabelEdit(NodeLabelEditEventArgs e);

    }
}
